<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>5.3. Diagram Business Copy Paste</title>
		<link type="text/css" rel="stylesheet" href="PLUGINS_ROOT/org.polarsys.capella.doc/html/styles.css"/>
	</head>
	<body>
		<h1 id="The_Diagram_Business_Copy-Paste">The Diagram Business Copy-Paste</h1>
		<p>Elements in a diagram can be copied and pasted via the usual CTRL-C and CTRL-V shortcuts, or via the &ldquo;Capella Copy/Paste&rdquo; contextual menu which pops up at right click.</p>
		<p>This copy/paste mechanism duplicates both the selected elements in the underlying model and their graphical representations. Business rules ensure that the model remains consistent after a paste operation. The business rules both depend on which diagram is being edited and which elements are selected.</p>
		<p>Also available mechanisms are:</p>
		<ul>
			<li>&ldquo;Paste with layout only&rdquo;: Pastes original layout but not style,</li>
			<li>&ldquo;Paste with style only&rdquo;: Pastes original style but not layout,</li>
			<li>&ldquo;Quick Paste&rdquo; (CTRL-SHIFT-V): Does not refresh the diagram after the paste operation (prevents edges from being drawn but saves time). It can be handy to paste elements multiple times and rearrange them by hand before refreshing the diagram (e.g. via the Refresh button in the toolbar).</li>
		</ul>
		<h2 id="Example_of_Logical_Architecture_Diagram">Example of Logical Architecture Diagram</h2>
		<p>To understand how the copy/paste mechanism works, let us consider the Logical Architecture Blank diagram as an example. In the figure below, the two subcomponents Sensor and Filter are selected.</p>
		<p>
			<img height="192" width="446" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_20311ae1.png"/>
		</p>
		<p>Let us execute the following steps: press CTRL-C, click the diagram background, move the mouse cursor below component Sensor Unit, then press CTRL-V. We obtain the following diagram.</p>
		<p>
			<img height="273" width="401" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_m51ff35d9.png"/>
		</p>
		<p>The selected subcomponents have been duplicated at the position of the mouse cursor (top-left corner). They have also been renamed. Components contain their input ports, so those have been duplicated. Note, however, that the functions have not been duplicated. This is because the sub components do not 
			<i>contain</i> the functions, but the functions are just 
			<i>allocated</i> to them. The allocations themselves could have been duplicated, so that Data reception would have been allocated to both Sensor and Sensor_1, but that would have been against the Capella Component to Functions allocation rules.
		</p>
		<p>We may want to duplicate the allocated functions and corresponding exchanges as well. For that purpose, let us select the components as before, plus a subset of the functions and exchanges, as in the figure below.</p>
		<p>
			<img height="200" width="477" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_m4a16833b.png"/>
		</p>
		<p>Let us execute the copy/paste steps as before: we then obtain the following diagram.</p>
		<p>
			<img height="320" width="476" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_33db2eed.png"/>
		</p>
		<p>All selected functions have been duplicated, which is why Init is not present. The selected exchanges whose source and target have been duplicated are connected to the copies. When the source only or the target only is duplicated, the other end is connected to the original function, which is why filtered data_1 is connected to Interpretation.</p>
		<h2 id="Example:_Component_External_Interfaces_Diagram">Example: Component External Interfaces Diagram</h2>
		<p>We have seen that whenever components are copy/pasted, their function allocations are not duplicated if the functions are not duplicated. This rule is specific to function allocations and Logical Architecture Blank diagrams. The behaviour can be different for other kinds of elements and diagrams.</p>
		<p>Let us consider a Component Internal Interfaces diagram. In the figure below, the select component is being copy/pasted.</p>
		<p>
			<img height="300" width="500" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_m597582b4.png"/>
		</p>
		<p>The resulting diagram is as follows.</p>
		<p>
			<img height="300" width="500" border="0" src="Images/5.3.%20Diagram%20Business%20Copy%20Paste_html_m5e9522c.png"/>
		</p>
		<p>We can notice that the Interface Use / Require and Interface Implementation / Provide relations have been duplicated and are linked to the original interfaces. This is again a specific business rule which aims at obtaining the expected result in one step.</p>
	</body>
</html>